package com.bank.action;

import javax.annotation.Resource;

import org.apache.struts2.ServletActionContext;
import org.springframework.stereotype.Controller;

import com.bank.svc.BankOnlineSvc;
import com.bank.tools.JSONOutput;
import com.opensymphony.xwork2.ActionSupport;

@SuppressWarnings("serial")
@Controller("bankOnlineAction")
public class BankOnlineAction extends ActionSupport{
	@Resource(name="bankOnlineSvc")
	private BankOnlineSvc bos;
	private String udoc;
	private String uphone;
	private String ucard;
	private String ostatus;
	
	public String changeStatus() throws Exception{
		System.out.println(uphone+","+udoc+","+ucard+","+ostatus);
		int flag=bos.changeOnlineStatus(uphone, udoc, ucard, ostatus);
		
		String json="{\"info\":"+flag+"}";
		JSONOutput.OutputJSON(ServletActionContext.getResponse(), json);
		return "success";
	}

	
	
	public void setBos(BankOnlineSvc bos) {
		this.bos = bos;
	}
	public void setUdoc(String udoc) {
		this.udoc = udoc;
	}
	public void setUphone(String uphone) {
		this.uphone = uphone;
	}
	public void setUcard(String ucard) {
		this.ucard = ucard;
	}
	public void setOstatus(String ostatus) {
		this.ostatus = ostatus;
	}
}
